// the vertex normal and vector from world vertex to light location
varying vec3 N, L;

void main() {
	// assign texture coord 
	gl_TexCoord[0] = gl_MultiTexCoord0;

	// std position transform  
	gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;  
	
	// calculate normal
	N = gl_NormalMatrix * gl_Normal; 
	
	// vertex in world space
	vec4 V = gl_ModelViewMatrix * gl_Vertex;  
	
	// use light 0 
	L = gl_LightSource[0].position.xyz - V.xyz;

	gl_FrontColor = gl_Color;
}
